<template>
	<view class="order-box">
		<view class="tab">
			<view class="item" @tap="tab(1)" :class="actInx ==1 ?'active':''">
				彩绘甲
			</view>
			<view class="item" @tap="tab(2)" :class="actInx ==2 ?'active':''">
				穿戴甲
			</view>
		</view>
		<view class="order-list">
			<view class="item" v-for="item in list" :key="item.id" @tap="goUrl(item)">
				<view class="top">
					<image src="../../static/30.png" class="img"></image>
					<view class="r">
						{{item.goodsName}} <text class="x">X{{item.goodsCount}}</text>
						<view class="price">
							<text class="t">￥</text>{{item.goodsTotalPrice}}
						</view>
						<view class="time">{{item.createTime}} <text class="zt" v-for="s in ztList" :key="s.id">{{s.id == item.goodsOrderStatus ? s.name:''}}</text></view>
					</view>
				</view>
			</view>
		</view>
		<!-- <Footer :index="3"/> -->
	</view>
</template>

<script>
	// import Footer from '@/components/footer.vue'
	import {getQueryMyOrderList} from '@/api/order.js'
	export default {
		components:{
			// Footer
		},
		data() {
			return {
				actInx: 2,
				list: [],
				ztList:[{
					name: '已下单',
					id: 1
				},{
					name: '已支付',
					id: 2
				},{
					name: '制作中',
					id: 3
				},{
					name: '已打包',
					id: 4
				},{
					name: '已发货',
					id: 5
				},{
					name: '已签收',
					id: 6
				}]
			};
		},
		onLoad() {
			this.getList()
		},
		methods:{
			tab(t){
				this.actInx = t
			},
			goUrl(ops){
				uni.navigateTo({
					url:'/pages/my/orderDetail?id='+ops.id
				})
			},
			getList(){
				getQueryMyOrderList().then((res) => {
					this.list = res
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	@bg: #EB8DA7;
	.order-box{
		padding-top: 32rpx;
		margin: 0 26rpx;
		.tab{
			border-radius: 81rpx;
			background: #E4919D;
			height: 90rpx;
			color: #fff;
			display: flex;
			.item{
				flex: 1;
				font-size: 28rpx;
				font-weight: 500;
				border-radius: 81rpx;
				margin: 5rpx;
				line-height: 88rpx;
				text-align: center;
			}
			.active{
				color: #333;
				background: #fff;
			}
		}
		
		.order-list{
			margin-top: 32rpx;
			.item{
				// height: 280rpx;
				border-radius: 24rpx;
				background-color: #fff;
				padding: 32rpx;
				margin-bottom: 32rpx;
			}
			.top{
				display: flex;
				position: relative;
				.img{
					width: 200rpx;
					height: 200rpx;
					border-radius: 16rpx;
					margin-right: 36rpx;
				}
				.r{
					font-size: 30rpx;
					color: #333;
					padding-top: 10rpx;
					flex: 1;
					.x{
						color: #666666;
						float: right;
					}
					.price{
						color: #E4919D;
						margin-top: 46rpx;
						font-size: 36rpx;
					}
					.t{
						font-size: 22rpx;
					}
					.time{
						color: #AAAAAA;
						font-size: 28rpx;
						padding-top: 12rpx;
						.zt{
							float: right;
							color: #666;
						}
					}
				}
			}
		}
	}
</style>
